package com.xbongbong.saas.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.businessproduct.pojo.dto.BusinessProductBatchListDTO;
import com.xbongbong.pro.businessproduct.pojo.dto.BusinessProductListDTO;
import com.xbongbong.pro.businessproduct.pojo.dto.BusinessProductListRelyDTO;
import com.xbongbong.pro.businessproduct.pojo.dto.BussinessProductBatchAutoMatchDTO;
import com.xbongbong.pro.businessproduct.pojo.vo.BusinessProductBatchListVO;
import com.xbongbong.pro.businessproduct.pojo.vo.BusinessProductListRelyVO;
import com.xbongbong.pro.businessproduct.pojo.vo.BusinessProductListVO;
import com.xbongbong.pro.detailtab.dto.DetailTabDataGetDTO;
import com.xbongbong.pro.detailtab.vo.ProductSummaryVO;
import com.xbongbong.pro.domain.entity.LinkProductRelyEntity;
import com.xbongbong.pro.product.pojo.vo.RelationProductListVO;

import java.util.Map;

/**
 * 业务产品service层接口
 *
 * @author chaoxiong.lei
 * @date 2019/3/7 16:00
 * @since v1.0
 **/
public interface BusinessProductService {
    /**
     * 获取各业务关联的产品列表(新建编辑页)
     *
     * @param businessProductListDTO
     * @author chaoxiong.lei
     * @Date 15:54 2019/3/7
     * @since v1.0
     **/
    BusinessProductListVO getBusinessProductList(BusinessProductListDTO businessProductListDTO) throws XbbException;

    /**
     * 获取各业务关联的产品列表(详情页)
     *
     * @param detailTabDataGetDTO
     * @author chaoxiong.lei
     * @Date 15:54 2019/3/7
     * @since v1.0
     **/
    BusinessProductListVO getBusinessProductList(DetailTabDataGetDTO detailTabDataGetDTO) throws XbbException;

    /**
     * 汇总各业务关联的产品列表(详情页，几种产品几件)
     *
     * @param detailTabDataGetDTO
     * @throws XbbException
     * @author long.rao
     * @date 2019-08-28 10:20
     */
    ProductSummaryVO summaryProductList(DetailTabDataGetDTO detailTabDataGetDTO) throws XbbException;

    /**
     * 获取产品的批次数据
     *
     * @param businessProductBatchListDTO
     * @author chaoxiong.lei
     * @Date 15:54 2019/3/7
     * @since v1.0
     **/
    BusinessProductBatchListVO getBusinessProductBathList(BusinessProductBatchListDTO businessProductBatchListDTO) throws XbbException;

    RelationProductListVO getRelationProductList(DetailTabDataGetDTO detailTabDataGetDTO) throws XbbException;

    BusinessProductListRelyVO businessProductListGetRely(BusinessProductListRelyDTO businessProductListRelyDTO) throws XbbException;

    Map<String, FieldAttrEntity> getProductRelyMap(String attr, LinkProductRelyEntity linkProductRelyEntity, Map<String, FieldAttrEntity> sourceExplainMap, Map<String, FieldAttrEntity> displayExplainListMap, Map<String, FieldAttrEntity> subLinkExplainMap, Map<String, String> thisToTarget);

    JSONObject formatThisFormData(Map<String, FieldAttrEntity> subDisplayExplainMap, Map<String, String> thisToTarget, JSONObject result);

    BusinessProductBatchListVO getProductAutoMatchBatch(BussinessProductBatchAutoMatchDTO bussinessProductBatchAutoMatchDTO) throws XbbException;

}
